<{if $check_version.crm.lowest_crm_version}>
<div class="notice clearfix tableform" id="update_notice">
  <div class="flt">
    <b class="f-14">  【注意事项】因会员接口，积分接口更新，初始化会员积分数据到CRM时，请务必确保绑定的CRM版本不低于2.2.8，否则可能会出现积分数据不统一的状况!</b>
  </div>
  <div class="frt">
    <span class="btn pointer close" onclick="$('update_notice').dispose();"><span><span>知道了</span></span></span>
  </div>
</div>
<{/if}>

<div class="notice clearfix tableform" id="browser_notice" style="display:none;">
  <div class="flt">
  <b class="f-14">您的浏览器已不受支持，我们强烈建议您升级或更换到新型浏览器，提升后台操作体验!</b>
  <p>被推荐的浏览器有：
    Google <a href="http://www.google.com/chrome?hl=zh-cn" target="_blank"><b class="c-blue">Chrome</b></a>、
    Mozilla <a href="http://www.mozillaonline.com/" target="_blank"><b class="c-blue">Firefox</b></a>、
    Microsoft <a href="http://www.microsoft.com/china/windows/internet-explorer/" target="_blank"><b class="c-blue">IE最新版</b></a>
  </p>
  </div>
  <div class="frt">
    <span class="btn pointer close" onclick="$('browser_notice').dispose();"><span><span>知道了</span></span></span>
  </div>
</div>

<script>
void function(){
  if(Browser.ie && Browser.version < 10){
    if('know'==Cookie.read('browser-notice'))return;
    $('browser_notice').show();
    $$('#browser_notice .close').addEvent('click',function(){
      Cookie.write('browser-notice','know',{duration:1});
    });
  }
   if('know'==Cookie.read('update-notice')){
   // $('update_notice').hide();
    return;
  }
  $$('#update_notice .close').addEvent('click',function(){
    Cookie.write('update-notice','know',{duration:1});
  });
}();
</script>
<div class="widgets clearfix">
  <{if $top|count}>
  <div id="t-1" class="wcol t-1 clearfix" layout="top">
    <{foreach from=$top item=widget name="widget"}>
      <div class="item widget <{$widget.className}>" id="<{$widget.class_full_name}>">
       <div class="dashbd-action"></div>
       <div class="dashbd-bd">
         <div class="dashbd-head clearfix">
          <div class="dashbd-headl span-auto"><{$widget.title}></div>
          <div class="flt sort">
            <div class="span-auto">
              <{img src="bundle/icon_asc.gif" class="move up" app='desktop' stye="cursor:pointer;float:left"}>
            </div>
            <div class="flt">
              <{img src="bundle/icon_desc.gif" class="move down" app='desktop' stye="cursor:pointer;float:left"}>
            </div>
          </div>
        </div>
        <div class="dashbd-list">
          <{$widget.html}>
        </div>
       </div>
       </div>
    <{/foreach}>
  </div>
  <{/if}>
  <div id="l-1" class="wcol l-1 flt" layout="left">
    <{foreach from=$left item=widget name="widget"}>
      <div class="item widget <{$widget.className}>" id="<{$widget.class_full_name}>">
        <div class="dashbd-action"></div>
        <div class="dashbd-bd">
          <div class="dashbd-head clearfix">
            <div class="dashbd-headl span-auto"><{$widget.title}></div>
            <div class="flt sort">
              <div class="span-auto">
                <{img src="bundle/icon_asc.gif" class="move up" app='desktop' stye="cursor:pointer;float:left"}>
              </div>
              <div class="flt">
                <{img src="bundle/icon_desc.gif" class="move down" app='desktop' stye="cursor:pointer;float:left"}>
              </div>
            </div>
          </div>
          <div class="dashbd-list">
            <{$widget.html}>
          </div>
        </div>
      </div>
    <{/foreach}>
  </div>
  <div id="l-2" class="wcol l-2 flt" layout="right">
    <{foreach from=$right item=widget name="widget"}>
      <div class="item widget <{$widget.className}>" id="<{$widget.class_full_name}>">
       <div class="dashbd-action"></div>
       <div class="dashbd-bd">
         <div class="dashbd-head clearfix">
          <div class="dashbd-headl span-auto"><{$widget.title}></div>
          <div class="flt sort">
            <div class="span-auto">
              <{img src="bundle/icon_asc.gif" class="move up" app='desktop' stye="cursor:pointer;float:left"}>
            </div>
            <div class="flt">
              <{img src="bundle/icon_desc.gif" class="move down" app='desktop' stye="cursor:pointer;float:left"}>
            </div>
          </div>
        </div>
        <div class="dashbd-list">
          <{$widget.html}>
        </div>
       </div>
       </div>
    <{/foreach}>
  </div>
  <div class="clear"></div>
  <{if $bottom|count}>
  <div id="b-1" class="wcol b-1 clearfix" layout="bottom">
    <{foreach from=$bottom item=widget name="widget"}>
      <div class="item widget <{$widget.className}>" id="<{$widget.class_full_name}>">
       <div class="dashbd-action"></div>
       <div class="dashbd-bd">
         <div class="dashbd-head clearfix">
          <div class="dashbd-headl span-auto"><{$widget.title}></div>
          <div class="flt sort">
            <div class="span-auto">
              <{img src="bundle/icon_asc.gif" class="move up" app='desktop' stye="cursor:pointer;float:left"}>
            </div>
            <div class="flt">
              <{img src="bundle/icon_desc.gif" class="move down" app='desktop' stye="cursor:pointer;float:left"}>
            </div>
          </div>
        </div>
        <div class="dashbd-list">
          <{$widget.html}>
        </div>
       </div>
       </div>
    <{/foreach}>
  </div>
  <{/if}>
</div>

<{area inject=".mainFoot"}>
<div class="note clearfix">
   <div class="span-auto">
         <{t}> 当前版本：<{/t}><{$deploy.product_name}>  V<{$deploy.product_version}><{if $deploy.business_version =='commerce_source' }>(onex_source)<{elseif $deploy.business_version =='commerce_standard'}>(onex_standard)<{else}>(<{$deploy.business_version}>)<{/if}>
     <a target="command::{title:'<{t}>检查更新<{/t}>'}" class="lnk" style="color:#3367ac" href="index.php?ctl=appmgr&act=fetchindex"><{t}>检查更新<{/t}></a>
    </div>
  <div class="user-tip frt">
    <b><{t}>你知道么?<{/t}>&nbsp;&nbsp;&nbsp;&nbsp;</b><span id="dashboard-tip"><{$tip}></span>
     &nbsp;<span class="lnk" onclick="$('dashboard-tip').set('opacity',0);new Request.HTML({url:'index.php?app=desktop&ctl=dashboard&act=fetch_tip',onComplete:function(){$('dashboard-tip').set('opacity',1);},update:'dashboard-tip',evalScripts:false}).get()"><{t}>再一条<{/t}></span>
  </div>

</div>

<{/area}>

<input type="hidden" id="dashboard-side-r-trigger"/>
<script>
  
   
  


  $$('.head-nav .wg').removeClass('current');
  
  (function(){


        new Side_R('index.php?app=desktop&ctl=dashboard&act=advertisement',{width:250,title:'<span class="font9px">advertisement</span>',trigger:$('dashboard-side-r-trigger'),
            onShow:function(){this.container.setStyle('overflow-y','hidden');},
            onHide:function(){this.container.setStyle('overflow-y','auto');}
        });

    var syncMoveState = (function(){
      $$('.widget .dashbd-head .move').hide().each(function(item){
        var _widget = item.getParent('.widget');
        var _p = _widget.getPrevious('.widget');
        var _n = _widget.getNext('.widget');
          if(item.hasClass('up')){
            item.setOpacity(_p?1:.2).store('disabled',_p?0:1);
          }else{
            item.setOpacity(_n?1:.2).store('disabled',_n?0:1);
          }
      });
      
      // var leftItems = $$('#l-1 .widget').setStyle('height','');
      // var rightItems = $$('#l-2 .widget').setStyle('height','');

      // leftItems.each(function(item){
      //   var r =rightItems.shift();
      //   if(r){
      //     new Equalizer($$(item,r)).equalize('height');
      //   }
      // });
      
      return arguments.callee;
    })();
    
    $$('.widget .dashbd-head .move').addEvent('click',function(){
      if(!!this.retrieve('disabled'))return;
      var _wcol = this.getParent('.wcol');
      var _widget = this.getParent('.widget');
      var _p = _widget.getPrevious('.widget');
      var _n = _widget.getNext('.widget');
      
      if(this.hasClass('up')){
        _widget.injectBefore(_p);
      }else{
        _widget.injectAfter(_n);
      }
      new Request().get('<{link app="desktop" ctl="dashboard" act="dashboard_sort"}>&sort='+_wcol.get('layout')+':'+_wcol.getElements('.widget').get('id').join(','));
      syncMoveState();
    });
    
    $$('.widget .dashbd-head').addEvents({
      mouseenter:function(){
        this.getElements('.move').show();
      },mouseleave:function(){
        this.getElements('.move').hide();
      }
    });
    
  
    
  })();
  
  
</script>
